package com.example.springbootproject.pojo;/*
 *@author 王志威
 *@datatime 2024/4/14 14:51
 *@editnote
 */

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Admin implements Serializable {
    private int id;
    //不能为空
    @NotNull(message = "用户名不能为空")
    //长度在3-6之间
    @Size(min = 3, max = 6, message = "用户名长度在3-6之间")
    //只能小写字母
    @Pattern(regexp = "^[a-z]+$",message = "用户名只能小写字母")
    private String userName;
    //加密后的密码
    @NotNull(message = "密码不能为空")
    //长度只能是6位
    @Size(min = 6, max = 6, message = "密码长度只能是6位")
    //只能是数字
    @Pattern(regexp = "^[0-9]+$",message = "密码只能是数字")
    private String encryptedPassword;
    //密码盐
    private String salt;


}
